import 'dart:async';
import 'package:bloc/bloc.dart';
import './bloc.dart';

class LoadingBloc extends Bloc<LoadingEvent, bool> {
  @override
  bool get initialState => false;

  @override
  Stream<bool> mapEventToState(
    LoadingEvent event,
  ) async* {
     switch(event) {
       case LoadingEvent.SHOW :
         yield true;
         break;
       case LoadingEvent.HIDE:
         yield false;
         break;
     }
  }
}
